    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
        <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
        <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
        <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
            <%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
        <!DOCTYPE html>
        <html lang="en">
        <head>
        <base href="<%=basePath%>">
        <meta charset="utf-8" />
        <title></title>
        <meta name="description" content="overview & stats" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link href="static/css/bootstrap.min.css" rel="stylesheet" />
        <link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="static/css/font-awesome.min.css" />
        <link rel="stylesheet" href="static/css/ace.min.css" />
        <link rel="stylesheet" href="static/css/ace-responsive.min.css" />
        <link rel="stylesheet" href="static/css/ace-skins.min.css" />
        <script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>

        <script type="text/javascript">
        $(top.hangge());

        //新增
        function addmenu(){
        top.jzts();
        var diag = new top.Dialog();
        diag.Drag=true;
        diag.Title ="新增菜单";
        diag.URL = '<%=basePath%>menu/toAdd';
        diag.Width = 500;
        diag.Height = 650;
        diag.CancelEvent = function(){ //关闭事件
        if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
        top.jzts();
        setTimeout("location.reload()",100);
        }
        diag.close();
        };
        diag.show();
        }

        //修改
        function editmenu(menuId){
        top.jzts();
        var diag = new top.Dialog();
        diag.Drag=true;
        diag.Title ="编辑菜单";
        diag.URL = '<%=basePath%>menu/toEdit?id='+menuId;
        diag.Width = 500;
        diag.Height = 650;
        diag.CancelEvent = function(){ //关闭事件
        if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
        top.jzts();
        setTimeout("location.reload()",100);
        }
        diag.close();
        };
        diag.show();
        }

        function delmenu(menuId,isParent){
        var flag = false;
        if(isParent){
        if(confirm("确定要删除该菜单吗？其下子菜单将一并删除！")){
        flag = true;
        }
        }else{
        if(confirm("确定要删除该菜单吗？")){
        flag = true;
        }
        }
        if(flag){
        top.jzts();
        var url = "<%=basePath%>menu/del?id="+menuId+"&guid="+new Date().getTime();
        $.get(url,function(data){
        if(data.code == 200){
        top.jzts();
        document.location.reload();
        } else {
        alert(data.msg)
        }
        });
        }
        }

        </script>
        </head>

        <body>
        <table style="width: 20%">
        <td style="vertical-align:top;">
        <c:if test="${fn:contains(butSet, 'add')}">
            <a class="btn btn-small btn-success" onclick="addmenu();" style="margin-left: 50px">新增</a>
        </c:if>
        </td>
        </tr>
        </table>
        <table id="table_report" class="table table-striped table-bordered table-hover">
        <thead>
        <tr>
        <th class="center" style="width: 50px;">序号</th>
        <th class='center'>名称</th>
        <th class='center'>资源路径</th>
        <th class='center'>排序</th>
        <th class='center'>操作</th>
        </tr>
        </thead>
        <c:choose>
            <c:when test="${not empty menuList}">
                <c:forEach items="${menuList}" var="model" varStatus="vs">
                    <tr id="tr${model.id }">
                    <td class="center">${vs.index+1}</td>
                    <td class='center'>${model.name }&nbsp;
                    <span class="label label-success arrowed">
                    <c:if test="${model.type == 1 }">路径</c:if>
                    <c:if test="${model.type == 2 }">菜单</c:if>
                    <c:if test="${model.type == 3 }">按钮</c:if>
                    </span>
                    </td>
                    <td>${model.url == '#'? '': model.url}</td>
                    <td class='center'>${model.orderNum }</td>
                    <td style="width: 25%;">
                    <c:if test="${fn:contains(butSet, 'edit')}">
                        <a class='btn btn-mini btn-info' title="编辑" onclick="editmenu('${model.id }')" >
                        <i class='icon-edit'></i>
                        </a>
                    </c:if>
                    <c:if test="${fn:contains(butSet, 'del')}">
                        <a class='btn btn-mini btn-danger' title="删除" onclick="delmenu('${model.id }',true)">
                        <i class='icon-trash'></i>
                        </a>
                    </c:if>
                    </tr>
                    <%--二级菜单--%>
                    <c:forEach items="${model.subMenu}" var="sMenu">
                        <tr style='height:24px;line-height:24px;' name='subTr${sMenu.id}'>
                        <td></td>
                        <td>
                        <span style='width:80px;display:inline-block;'></span>
                        <c:choose>
                            <c:when test="subvs == ${fn:length(model.subMenu)-1}">
                                <img src='static/images/joinbottom.gif' style='vertical-align: middle;'/>
                            </c:when>
                            <c:otherwise>
                                <img src='static/images/join.gif' style='vertical-align: middle;'/>
                            </c:otherwise>
                        </c:choose>
                        <span style='width:100px;text-align:left;display:inline-block;'>
                        ${sMenu.name}
                        <span class="label label-success arrowed">
                        <c:if test="${sMenu.type == 1 }">路径</c:if>
                        <c:if test="${sMenu.type == 2 }">菜单</c:if>
                        <c:if test="${sMenu.type == 3 }">按钮</c:if>
                        </span>
                        </span>
                        </td>
                        <td>${sMenu.url}</td>
                        <td class='center'>${sMenu.orderNum}</td>
                        <td>
                        <c:if test="${fn:contains(butSet, 'edit')}">
                            <a class='btn btn-mini btn-info' title='编辑' onclick="editmenu('${sMenu.id }')"><i
                            class='icon-edit'></i></a>
                        </c:if>
                        <c:if test="${fn:contains(butSet, 'del')}">
                            <a class='btn btn-mini btn-danger' title='删除' onclick="delmenu('${sMenu.id }',false)"><i
                            class='icon-trash'></i></a>
                        </c:if>
                        </td>
                        </tr>
                        <%--三级菜单或按钮--%>
                        <c:forEach items="${sMenu.subMenu}" var="ssMenu">
                            <tr style='height:24px;line-height:24px;' name='subTr${ssMenu.id}'>
                            <td></td>
                            <td>
                            <span style='width:120px;display:inline-block;'></span>
                            <c:choose>
                                <c:when test="subvs == ${fn:length(sMenu.subMenu)-1}">
                                    <img src='static/images/joinbottom.gif' style='vertical-align: middle;'/>
                                </c:when>
                                <c:otherwise>
                                    <img src='static/images/join.gif' style='vertical-align: middle;'/>
                                </c:otherwise>
                            </c:choose>
                            <span style='width:100px;text-align:left;display:inline-block;'>
                            ${ssMenu.name}
                            <span class="label label-success arrowed">
                            <c:if test="${ssMenu.type == 1 }">路径</c:if>
                            <c:if test="${ssMenu.type == 2 }">菜单</c:if>
                            <c:if test="${ssMenu.type == 3 }">按钮</c:if>
                            </span>
                            </span>
                            </td>
                            <td>${ssMenu.url}</td>
                            <td class='center'>${ssMenu.orderNum}</td>
                            <td>
                            <c:if test="${fn:contains(butSet, 'edit')}">
                                <a class='btn btn-mini btn-info' title='编辑' onclick="editmenu('${ssMenu.id }')"><i
                                class='icon-edit'></i></a>
                            </c:if>
                            <c:if test="${fn:contains(butSet, 'del')}">
                                <a class='btn btn-mini btn-danger' title='删除' onclick="delmenu('${ssMenu.id }
                                ',false)"><i class='icon-trash'></i></a>
                            </c:if>
                            </td>
                            </tr>
                            <%--四级纯按钮--%>
                            <c:forEach items="${ssMenu.subMenu}" var="sssMenu">
                                <tr style='height:24px;line-height:24px;' name='subTr${sssMenu.id}'>
                                <td></td>
                                <td>
                                <span style='width:140px;display:inline-block;'></span>
                                <c:choose>
                                    <c:when test="subvs == ${fn:length(ssMenu.subMenu)-1}">
                                        <img src='static/images/joinbottom.gif' style='vertical-align: middle;'/>
                                    </c:when>
                                    <c:otherwise>
                                        <img src='static/images/join.gif' style='vertical-align: middle;'/>
                                    </c:otherwise>
                                </c:choose>
                                <span style='width:100px;text-align:left;display:inline-block;'>
                                ${sssMenu.name}
                                <span class="label label-success arrowed">
                                <c:if test="${sssMenu.type == 1 }">路径</c:if>
                                <c:if test="${sssMenu.type == 2 }">菜单</c:if>
                                <c:if test="${sssMenu.type == 3 }">按钮</c:if>
                                </span>
                                </span>
                                </td>
                                <td>${sssMenu.url}</td>
                                <td class='center'>${sssMenu.orderNum}</td>
                                <td>
                                <c:if test="${fn:contains(butSet, 'edit')}">
                                    <a class='btn btn-mini btn-info' title='编辑' onclick="editmenu('${sssMenu.id }')"><i
                                    class='icon-edit'></i></a>
                                </c:if>
                                <c:if test="${fn:contains(butSet, 'del')}">
                                    <a class='btn btn-mini btn-danger' title='删除' onclick="delmenu('${sssMenu.id }
                                    ',false)"><i class='icon-trash'></i></a>
                                </c:if>
                                </td>
                                </tr>
                            </c:forEach>
                        </c:forEach>
                    </c:forEach>
                </c:forEach>
            </c:when>
            <c:otherwise>
                <tr>
                <td colspan="100">没有相关数据</td>
                </tr>
            </c:otherwise>
        </c:choose>
        </table>

        <div class="page_and_btn">
        <div>
        </div>
        </div>

        </body>
        </html>